﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Topshelf;
namespace ZX.Quartz
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            var host = HostFactory.New(x =>
            {
                x.EnableDashboard();
                x.Service<Quartz>(s =>
                {
                    s.SetServiceName("中旭系统服务");
                    s.ConstructUsing(name => new Quartz());
                    s.WhenStarted(tc => { tc.OnStart(); });
                    s.WhenStopped(tc => { tc.OnStop(); });
                });
            });
           
            //System.ServiceProcess.ServiceBase[] ServicesToRun;
            //// 同一进程中可以运行多个用户服务。若要将
            //// 另一个服务添加到此进程，请更改下一行
            //// 以创建另一个服务对象。例如，
            ////
            ////   ServicesToRun = New System.ServiceProcess.ServiceBase[] {new Service1(), new MySecondUserService()};
            ////
            
            
            //ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Quartz() };
            //System.ServiceProcess.ServiceBase.Run(ServicesToRun);
            
        }
    }
}
